package com.dingwen.ssl.entity;

import org.springframework.beans.factory.BeanNameAware;

/**
 * <p>
 *  user entity
 *      BeanNameAware 案例： 使得Bean能够感知到自身的BeanName(对应Spring IOC容器中的Bean Id)
 * </P>
 *
 * @author dingwen
 * @date 2021.10.11 09:37
 */
public class UserAware implements BeanNameAware {
    /**
     * id
     */
    private String id;
    /**
     * 名字
     */
    private String name;
    /**
     * 地址
     */
    private String address;

    @Override
    public void setBeanName(String name) {
        this.id = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "UserAware{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", address='" + address + '\'' +
                '}';
    }
}
